package com.ranjiaqi.homework;


import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

/**
 * @ClassName homework01
 * @Description TODO
 * @Author hp
 * @Date 2021/7/1 10:30
 * @Version 1.0
 **/
public class homework01 {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService service = Executors.newFixedThreadPool(2);
        Future<Integer> num = service.submit(new SubRunnable(100));
        Future<Integer> num1 = service.submit(new SubRunnable(200));
        System.out.println(num.get());
        System.out.println(num1.get());
    }
}
